package com.pomr.service.equipmentstorage;

import java.util.List;
import java.util.Map;

import com.pomr.entity.StorageAllocation;
import com.pomr.model.equipmentstorage.AllocationMessage;
import com.pomr.model.equipmentstorage.EquipmentStorage;
import com.pomr.model.equipmentstorage.EquipmentStorageDetail;
import com.pomr.model.menu.EquipmentKind;
import com.pomr.model.sys.User;
import com.pomr.util.common.ResponseData;
import com.pomr.util.page.Page;
import com.pomr.util.page.PageParam;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletRequest;

public interface StorageService {
	/**
	 * 查询库存记录
	 * @param equipmentid
	 * @param agencyid
	 * @param manufacturerid
	 * @param page
	 * @param limit
	 * @return
	 * @throws Exception
	 */
	public Page<List<EquipmentStorage>> searchStorages(String equipmentid, String agencyid, String manufacturerid, String page, String limit) throws Exception;
	
	/**
	 * 通过主表id查询库存详细信息 
	 * @param storage
	 * @return
	 * @throws Exception
	 */
	public Page<List<EquipmentStorageDetail>> searchStorageDetails(String id, String page, String limit) throws Exception;
	
	/**
	 * 删除设备信息
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public boolean deleteStorageDetails(String[] ids) throws Exception;
	
	/**
	 * 设备报损
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public boolean damageStorageDetails(String[] ids) throws Exception;
	/**
	 * 设备清库
	 * @param ids 
	 * @param reason 原因
	 * @return
	 * @throws Exception
	 */
	public boolean cleanStorageDetails(String[] ids,String reason) throws Exception;
	
	/**
	 * SIM卡修复
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public boolean repairStorageDetails(String[] ids) throws Exception;
	
	/**
	 * 更新设备领用定金
	 * @param storage
	 * @return
	 * @throws Exception
	 */
	public boolean editMoney(EquipmentStorage storage) throws Exception;
	/**
	 * 库存调拨
	 * @param id
	 * @param sn1
	 * @param sn2
	 * @return 库存更新数目
	 * @throws Exception
	 */
	public int allocationStorage(String id, String sn1, String sn2, String agid,User user) throws Exception;
	
	/**
	 * 模糊查询设备
	 * @param page
	 * @param limit
	 * @param sn
	 * @return
	 * @throws Exception
	 */
	public Page<List<EquipmentStorageDetail>> searchEquipmentsBySn(String page, String limit, String sn, User user) throws Exception;

	/**
	 * 设备报修
	 * @param sn 设备sn编码
	 * @param reason 报修原因
	 * @return
	 * @throws Exception
	 */
	public ResponseData repairEquip(String sn, String reason) throws Exception;

	public List<EquipmentKind> searchEquipmentByAgency(String agencyid) throws Exception;

	public ResponseData seachDetailsBySn(String storageId, String sn1, String sn2) throws Exception;

	public ResponseData storageAllocation(StorageAllocation storageAllocation, User user) throws Exception;

	public Page<List<AllocationMessage>> findAllocationMessages(PageParam param, User user) throws Exception;

	public ResponseData seachAllocationMessageDetails(String aid)throws Exception;

}
